﻿module main;

import std.stdio;
import std.random;
import std.datetime;

// random generátor sebességteszt
void test() {
	auto rnd = Random(55555);
	for(int i = 0; i < 10000; ++i) {
//		auto n = rnd.front();
		auto r = uniform(0.0L, 1000000.0L, rnd);
	}
}

// random generátor azonosságteszt
void test2() {
	auto rnd = Random(55555);

	for(int i = 0; i < 10; ++i) {
		write(uniform(0.0L, 1000000.0L, rnd), " ");	
	}
	writeln();
	
	rnd = Random(55555);

	for(int i = 0; i < 10; ++i) {
		write(uniform(0.0L, 1000000.0L, rnd), " ");	
	}
	writeln();
}


int main(string[] argv)
{
   writeln("randperftest starting");

	int n = 10_000;
	auto r = benchmark!(test)(n);
	writefln("Seconds to call test %s times: %s", n, r[0].to!("seconds", float));
	
	test2();	
	
	scope(exit) writeln("randperftest ending");
	return 0;
}
